import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '料号',
    align:"center",
    dataIndex: 'objectId',
    width:120
   },
   {
    title: '料号编码',
    align:"center",
    dataIndex: 'objectCode',
    ifShow:false
   },
   {
    title: '品名',
    align:"center",
    dataIndex: 'objectName',
    width: 280
   },
   {
    title: '规格',
    align:"center",
    dataIndex: 'specification',
    width: 100
   },
   {
    title: '单位',
    align:"center",
    dataIndex: 'unit',
    width: 80
   },
   {
    title: '存储地点',
    align:"center",
    dataIndex: 'storageLocation',
    width: 100
   },
   {
    title: '供应数量',
    align:"center",
    dataIndex: 'supplyQuantity',
    width: 100
   },
   {
    title: '需求数量',
    align:"center",
    dataIndex: 'quantityRequired',
    width: 100
   },
   {
    title: '现存量',
    align:"center",
    dataIndex: 'standingStock',
    width: 100
   },
   {
    title: '可用量',
    align:"center",
    dataIndex: 'availableQuantity',
    width: 100
   },
   {
    title: '获取时间',
    align:"center",
    dataIndex: 'acquisitionTime'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remark',
    ifShow:false
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "存储地点",
    field: "storageLocation",
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: "料号",
    field: "objectId",
    component: 'Input',
    colProps: { span: 6 },
  },
  // {
  //   label: "库位",
  //   field: "",
  //   component: 'Input',
  //   colProps: { span: 6 },
  // },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '料号',
    field: 'objectId',
    component: 'Input',
  },
  {
    label: '料号编码',
    field: 'objectCode',
    component: 'Input',
  },
  {
    label: '料品名',
    field: 'objectName',
    component: 'Input',
  },
  {
    label: '规格',
    field: 'specification',
    component: 'Input',
  },
  {
    label: '单位',
    field: 'unit',
    component: 'InputNumber',
  },
  {
    label: '存储地点',
    field: 'storageLocation',
    component: 'Input',
  },
  {
    label: '供应数量',
    field: 'supplyQuantity',
    component: 'Input',
  },
  {
    label: '需求数量',
    field: 'quantityRequired',
    component: 'Input',
  },
  {
    label: '现存量',
    field: 'standingStock',
    component: 'Input',
  },
  {
    label: '可用量',
    field: 'availableQuantity',
    component: 'Input',
  },
  {
    label: '获取时间',
    field: 'acquisitionTime',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
	  show: false
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}